//
//  JoinTeamTableViewCell.m
//  MeterMart
//
//  Created by ENERGY on 2018/10/31.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "JoinTeamTableViewCell.h"

@interface JoinTeamTableViewCell ()

@end
@implementation JoinTeamTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = getColor(mainColor);
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.img];
        [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.centerY.equalTo(weakSelf.contentView);
            make.width.height.mas_offset(SCREEN_WIDTH - 100/WIDTH_6_SCALE);
        }];
    }return self;
}

- (UIImageView *)img{
    if (!_img) {
        _img = [[UIImageView alloc] init];
        _img.backgroundColor = getColor(textGrayColor);
    }return _img;
}

- (void)setModel:(NSDictionary *)model{
    _model = model;
    [self.img sd_setImageWithURL:[NSURL URLWithString:model[@"qrcode"][@"extension"]] placeholderImage:[UIImage imageNamed:@""]];
}
@end
